﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Cube : MonoBehaviour, IObserver<DataType> {

	public float _moveTime = 2.0f;
	public AnimationCurve _animationCurve;
	public ISubject<DataType> Publisher { get; set; }

	void Start () {

		Publisher = FindObjectOfType<Ball> ();

		Publisher.PublicAction += Subscriber;
	}
	public void Subscriber (DataType data) {
		transform.position = Vector3.Lerp (transform.position, data.pos, Time.deltaTime);
	}
}